# -*- coding:utf-8 -*-
'''
@Date:2022/10/3  20:56
@Author:一加一
'''

from tools.operate_config import OperateConfig
from urllib.parse import urljoin

class ApiPath:

    '''管理api地址'''

    def __init__(self,env=None):
        if env is None:
            self.env = OperateConfig().get_node_value('ENV', 'env')
        else:
            self.env = env

        self.gs_host_url = OperateConfig().get_node_value(self.env,'gs_host_url') # 读取配置文件config.ini的业务系统接口域名
        #self.gs_host_url = OperateConfig().get_node_value(self.env, 'gs_host_url') #读取配置文件config.ini 的gs_host域名




        #-----------------接口------------------
        #登录接口
        self.login = urljoin(self.gs_host_url, "/gst/broadcast/cms/login")   #登录
        self.s_exchangeToken_url = urljoin(self.login,"/")


        #  停止播放接口
        self.audio_stop = urljoin(self.gs_host_url, "/iot/standard/device/operate/v1/audioStop")
        # 调节音量接口
        self.volume_set = urljoin(self.gs_host_url, "/iot/standard/device/operate/v1/volumeSet")

        # 文件上传到设备
        self.audio_Upload = urljoin(self.gs_host_url, "/iot/standard/device/operate/v1/audioUpload")
        # 播放音频文件
        self.audio_play = urljoin(self.gs_host_url, "/iot/standard/device/operate/v1/audioPlay")

        #查询已上传的文件列表
        self.UploadAudioList = urljoin(self.gs_host_url, "/iot/standard/device/manage/v1/queryUploadAudioList")

        # 查询媒体库的音频文件列表
        self.queryMediaList = urljoin(self.gs_host_url, "/open-api/media/manage/queryMediaList")

        #TTS播放
        self.speechSynthesisPlay = urljoin(self.gs_host_url,"/open-api/device/operate/speechSynthesisPlay")



